#include<bits/stdc++.h>
using namespace std;
int main(){
	// freopen("bank.in" , "r" , stdin);
	// freopen("bank.out" , "w" , stdout);
	long long n;
	cin >> n;
	if(n >= 0){
		cout << n << endl;
		return 0;
	}
	if(n < 0){
		long long i = -n , j = -n;
		long long a , b;
		a = j % 10;
		j = j / 10;
		b = j % 10;
		j = j / 10;
		if(a >= b){
			i = 10 * j + b;
			if (i == 0){
				cout << 0 << endl;
			}
			cout << -i << endl;
		}
		else{
			i = 10 * j + a;
			if (i == 0){
				cout << 0 << endl;
			}
			cout << -i << endl;
		}
	}
	return 0;
}
